home *** CD-ROM | disk | FTP | other *** search
- Path: diable.upc.es!eduarde
- From: eduarde@ac.upc.es (Eduard Elias i Vila)
- Newsgroups: comp.lang.c++
- Subject: more sampling from a sound card in VC++
- Date: 27 Mar 1996 10:49:09 GMT
- Organization: Departament D'arquitectura de Computador (UPC)
- Message-ID: <4jb6f5$f7c@diable.upc.es>
- NNTP-Posting-Host: nebot.ac.upc.es
- Mime-Version: 1.0
- Content-Type: text/plain; charset=iso8895-1
- Content-Transfer-Encoding: 7bit
- X-Newsreader: TIN [version 1.2 PL2]
-
-
-
- One of my students is trying to built, with me, a program able to determine
- the pitch of a note singed in front of a microphone connected to a soundblaster
- compatible card.
-
- He is programming in Visual C++, on windows (3.1, not Windows 95). He
- doesn't have net access, so I report the following problem:
-
- To read from the sound card, he uses a sentence like this:
-
-
- Error = waveInOpen( ... , Window1, 0, CALLBACK_WINDOW);
- ^^^^^^^(the forth parameter)
-
- The problem is with the Window1. It is declared as a HWND. He saw that,
- depending on the definition or not of STRICT, this type is a UINT (when
- STRICT is not defined) or a pointer to a struct (const struct::HWND__ __near*
- when STRICT is defined).
-
- The call waveInOpen needs Window1 to be a UINT but if he undefines the
- symbol STRICT, then some other problems appear at link time.
-
- I reported this problem some days ago but, as it is still not solved, I
- repost it with more information. We have tried the following possibilities:
-
- 1) STRICT defined
- HWND Window1 as the declaration of Window1
- (UINT) Window1 in the call to waveInOpen
-
- No problem at compilation or linking time.
- At run time, the waveInOpen call, returns an external undefined error.
-
- 2) STRICT defined
- HWND Window1 as the declaration of Window1
- (DWORD) Window1 in the call to waveInOpen (some suggested this last time)
-
- At compilation time gives a warning about the type casting.
- At run time it gives the same error than option 1.
-
- 3) STRICT undefined at the start and for all the program
- HWND Window1 as the declaration of Window1
- Window1 or (UINT) Window1 in the call to waveInOpen
-
- At linking time gives the error "protected: virtual long (_far __pascal
- *__ near**__far pascal CWND: GetsuperwndProc Addr (void) __near
- (unsigned int, unsigned int, unsigned int, long): unresolved
- external" and similars for a very long list of calls from the
- libraries (like this GetsuperwndProc, for instance).
- (I didn't write carefully the error, so I'm not sure about the quan-
- tities of _ and spaces in it)
-
- 4) STRICT undefined only in the portion that includes the declaration of
- Window1 and the call to waveInOpen.
- HWND Window1 as the declaration of Window1
- Window1 or (UINT) Window1 in the call to waveInOpen
-
- The same results than in option 1.
-
-
- I'm just looking for "the right option we still didn't try". Any help will
- be very, very, very much appreciated. Thanks in advance.
-
-
- --
-
- Eduard Elias i Vila
- eduarde@ac.upc.es
-